FROM bishengjdk-17:latest

RUN set -eux; \
    dnf install -y unzip findutils && dnf clean all

ARG GRADLE_VERSION=8.14.2

COPY init.gradle .

RUN set -eux; \
    curl -o gradle.zip https://mirrors.cloud.tencent.com/gradle/gradle-${GRADLE_VERSION}-bin.zip && \
    unzip gradle.zip -d /opt/ && mv /opt/gradle-${GRADLE_VERSION} /opt/gradle && \
    mkdir /root/.gradle && mv init.gradle /root/.gradle/init.gradle && \
    rm -rf gradle.zip

RUN set -eux; \
    mkdir -p /root/ProjectRoot

VOLUME ["/root/ProjectRoot"]

ENV GRADLE_HOME /opt/gradle
ENV PATH $GRADLE_HOME/bin:$PATH

CMD ["gradle", "-v"]
